su root
mkdir workdir
cd workdir
mkdir cd
mount /dev/cdrom cd
mount -o loop 挂载的镜像名称.iso cd
mkdir newcd
cp -a cd/* newcd/
rm newcd/casper/filesystem*
mkdir s
mount -o loop -t squashfs cd/casper/filesystem.squashfs s
mkdir edit
cp -a s/* edit/
cp /etc/resolv.conf edit/etc/
chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
export HOME=/root
sudo apt-get install htop
apt-get clean
rm -rf /tmp/*su root
umount /proc
umount /sys
exit
rm -r edit/root
cp -a s/root edit/
mksquashfs edit newcd/casper/filesystem.squashfs
chroot edit dpkg-query -W –showformat=’${Package} ${Version}\n’ > newcd/casper/filesystem.manifest
cp newcd/casper/filesystem.manifest newcd/casper/filesystem.manifest-desktop
rm newcd/md5sum.txt
cd newcd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt
mkisofs -r -V “Ubuntu Live Custom” -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ../Ubuntu-Live-Custom.iso .